<template>
  <div>
    {{ hosName }}
    <el-amap :center="center" vid="amapDemo" class="map">
      <el-amap-marker
        vid="component-marker"
        :position="center"
      ></el-amap-marker>
    </el-amap>
  </div>
</template>

<script>
export default {
  data() {
    return {
      center: [],
      hopName: "",
    };
  },
  computed: {},
  methods: {},
  created() {
    //接受其他页面跳转携带的参数
    // console.log(this.$router.query);
    let { longitude, latitude, name } = this.$route.query;
    this.center = [longitude, latitude];
    this.hopName = name;
  },
  mounted() {},
};
</script>
<style scoped>
.map {
  height: 400px;
}
</style>